﻿@model IEnumerable<ITProject.WebUI.Models.Project.ProjectFeatureViewModel>
@{
    ViewBag.Title = "Funkcjonalności projektu " + ViewData["ProjectName"].ToString();
    Layout = "~/Views/Shared/_Layout.cshtml";
}





<h2>Funkcjonalnosci projektu @Html.Encode(ViewData["ProjectName"])</h2>



<div class="Pmenu">
@Html.Partial(MVC.Shared.Views.Partials._ProjectMenuControl, 
        new ITProject.WebUI.Models.Project.ProjectMenuViewModel { ProjectName = (string)ViewData["ProjectName"], Role = (ITProject.Domain.UserRole)ViewData["Role"] })
</div>
<div class="PAplane">


<div>
    @{
    int i = 0;
}
@foreach (var item in Model)
{
         i++;
     <div>
        <span class="callTH" style="width:150px">
            Nazwa 
        </span>
        <span  class="callTH" style="width:300px">
            Opis
        </span>        
        <span  class="callTH" style="width:100px">Status</span>
        <span  class="callTH" style="width:100px">Priorytet</span>
 

</div>
        <span style="width:150px; min-height:20px;"  class="call">
            @Html.DisplayFor(modelItem => item.Name)
        </span>
        <span style="width:300px; min-height:20px;" class="call">
            @Html.DisplayFor(modelItem => item.Description)
        </span>        
        <span style="width:100px; min-height:20px;" class="call">
            @Html.DisplayFor(modelItem => item.Status)
        </span>
            <span style="width:100px; min-height:20px;" class="call">
            @Html.DisplayFor(modelItem => item.Priority)
        </span>  

        <hr style="margin:0px;border-color:Black"/>
  
        <span style="width:210px; min-height:40px; vertical-align:middle;" class="call">
         <b>Data rozpoczęcia:</b>
            @Html.DisplayFor(modelItem => item.StartDate)
        </span>
    
       <span style="width:310px; min-height:40px;" class="call">
            <b>Planowana data zakonczenia:</b> @Html.DisplayFor(modelItem => item.PlannedEndDate)
        </span>
            <span style="width:135px; min-height:40px;" class="call">
             <b>Wykonawca:</b>
            @Html.DisplayFor(modelItem => item.Receiver)
            @if (item.IsToTeam)
            {
                @:(Zespół)
            }
        </span> 
    <br />
            <span id="@i.ToString()" style="width:650px" class="showUser" >Historia zmian
        </span><br />
     
                 string id = i.ToString() + "U";
 
    <div id="@id.ToString()" style="display:none" class="userss">
    @if (item.FeatureStatusChanges.Length == 0)
    {
        <span  class="listU">brak</span>
    }
    else
    {
        <span class="callTH" style="width:150px">Data zmiany</span>
        <span class="callTH" style="width:100px">Stary Status</span>
        <span class="callTH" style="width:100px">Nowy Status</span>
        <span class="callTH" style="width:190px">Komentarz</span>
        <span class="callTH" style="width:90px">Przez</span><br />
    }

    @foreach (ITProject.WebUI.Models.Project.StatusChangeViewModel items in item.FeatureStatusChanges)
    {

        <span class="listU" style="width:150px;min-height:40px;">
        @Html.DisplayFor(model => items.DateOfChange)
        </span>
        
        <span class="listU" style="width:102px; min-height:40px;">
        @Html.DisplayFor(model => items.OldStatus)
        </span>
        
        <span class="listU" style="width:102px; min-height:40px;">
        @Html.DisplayFor(model => items.NewStatus)
        </span>
        
        <span class="listU" style="width:192px; min-height:40px;">
        @Html.DisplayFor(model => items.Comment)
        </span>
        <span class="listU" style="width:91px; min-height:40px;">
        @Html.DisplayFor(model => items.User)
        </span>
       <br />
    } 
    </div>
}

</div>
</div>
<div class="clear"></div>